﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="jsTreeDemo_Files.aspx.cs" Inherits="FilesArranger.jsTreeDemo_Files" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title></title>
	<link rel="stylesheet" type="text/css" href="jsTree/themes/default/style.css" />
	<script type="text/javascript" src="jsTree/_lib/jquery.js"></script>
	<script type="text/javascript" src="jsTree/jquery.jstree.js"></script>
	<link type="text/css" href="Styles/filetree.css" rel="stylesheet" />
	<script type="text/javascript">
		$(function ()
		{
			var startTime;
			$("#RootNodeDiv").jstree({
				"plugins": ["themes", "json_data", "ui", "contextmenu"],
				"core": { "animation": 0 },
				"json_data": {
					"data": [
						{
							"data": "A node",
							"state": "closed"
						},
						{
							"attr": { "id": "li.node.id" },
							"data": {
								"title": "Long format demo",
								"attr": { "href": "#" },
								"children": {
									"data": [
										{
											"data": "A node",
											"state": "closed"
										},
										{
											"attr": { "id": "li.node.id" },
											"data": {
												"title": "Long format demo",
												"attr": { "href": "#" }
											}
										}
									]
								}
							}
						}
					],
					"ajax": {
						"url": location.href.split("#")[0].split("?")[0] + "?action=" + encodeURIComponent("LoadChildren"),
						"type": "POST",
						"beforeSend": function () { startTime = new Date(); },
						"complete": function () { alert(new Date().getTime() - startTime.getTime()); }
					}
				},
				"contextmenu": {
					"select_node": true,
					"show_at_node": true,
					"items": {
						"create": null,
						"rename": null,
						"remove": null,
						"ccp": null,
						"弹出对话框": {
							"label": "弹出对话框",
							"action": function (obj) { alert(obj) }
						},
						"弹出对话框2": {
							"label": "弹出对话框",
							"action": function (obj) { alert(obj) }
						},
						"包含子级菜单": {
							"label": "包含子级菜单",
							"submenu": {
								"cut": {
									"separator_before": false,
									"separator_after": true,
									"label": "Cut",
									"action": function (obj) { alert("Cut") }
								}
							}
						}
					}

				}
			});
		});

		//		$(function ()
		//		{
		//			$("#RootNodeDiv").tree([{
		//				data: {
		//					type: "json", // ENUM [json, xml_flat, xml_nested, predefined]
		//					method: "GET",        // HOW TO REQUEST FILES
		//					async: false,        // BOOL - async loading onopen
		//					async_data: function (NODE) { return { id: $(NODE).attr("id") || 0} }, // PARAMETERS PASSED TO SERVER
		//					url: false,        // FALSE or STRING - url to document to be used (async or not)
		//					json:          // FALSE or OBJECT if type is JSON and async is false - the tree dump as json
		//					{
		//					state: "closed",
		//					attributes: { id: "node_identificator" },
		//					data: { title: "node_title", icon: "filetypeIcon/_zip.gif", attributes: { "key": "value"} },
		//					children: [ /* an array of child nodes objects */]
		//				}
		//			},
		//			selected: false,        // FALSE or STRING or ARRAY
		//			opened: [],           // ARRAY OF INITIALLY OPENED NODES
		//			languages: [],           // ARRAY of string values (which will be used as CSS classes - so they must be valid)
		//			path: false,        // FALSE or STRING (if false - will be autodetected)
		//			cookies: false        // FALSE or OBJECT (prefix, open, selected, opts - from jqCookie - expires, path, domain, secure)

		//		}]);
		//	});
	</script>
</head>
<body>
	<div id="MainBody">
		<div id="header">
			<h1>
				Files Operator 文件浏览器</h1>
		</div>
		<div id="loginBox">
			<form id="Login" onsubmit="return Login_onsubmit()" action="">
			<%if ((UserEntry)Session["logined"] == null)
	 {%>
			<div id="loginDiv">
				<label for="username">
					用户：</label><input type="text" id="username" name="username" value="admin" /><br />
				<label for="password">
					密码：</label><input type="password" id="password" name="password" value="adminer" /><br />
				<input id="submitbutton" type="submit" value="登录" />
			</div>
			<%}%>
			<div id="loginstatus">
				<%if ((UserEntry)Session["logined"] != null)
	  {%><input type="button" value="登出" onclick="logout();" /><%}%></div>
			</form>
		</div>
		<div id="folderToolBar">
			<input title="刷新" onclick="Refresh();" type="button" style="width: 36px; height: 36px; background: url(images/refresh.gif)" />
			<input disabled="disabled" type="button" title="删除" style="width: 36px; height: 36px; background: url(images/del.gif)" />
			<input disabled="disabled" type="button" title="复制" style="width: 36px; height: 36px; background: url(images/copy.gif)" />
			<input disabled="disabled" type="button" title="剪切" style="width: 36px; height: 36px; background: url(images/cut.gif)" />
			<input disabled="disabled" type="button" title="粘贴" style="width: 36px; height: 36px; background: url(images/paste.gif)" />
			<input disabled="disabled" type="button" title="压缩" style="width: 36px; height: 36px; background: url(images/RarAdd.gif)" />
			<input disabled="disabled" type="button" title="解压" style="width: 36px; height: 36px; background: url(images/RarExt.gif)" />
		</div>
		<div id="folderDiv">
			<div class="inner">
				<div class="inside" style="padding-left: 0.5em;">
					<div id="RootNodeDiv" data-value="/">
					</div>
				</div>
			</div>
		</div>
		<div id="PageTitles">
			<div id="PageTitlesList">
				▼</div>
			<div id="PageTitlesMoveLeft" onclick="PageTitlesMoveLeft();">
				﹤</div>
			<div id="PageTitlesMoveRight" onclick="PageTitlesMoveRight();">
				﹥</div>
			<div id="PageTitlesDoor">
				<div id="PageTitlesOuter">
					<div id="PageTitlesFloater">
						<div onclick="SwitchPage(this.id);" class="PageTitleActive" id="StartPageTitle" title="起始页">
							<a href="#" onfocus="this.blur();" onclick="return false;">
								<!--<span class="PageCloseButton" title="关闭" onclick="return PageClose(this.parentNode.parentNode.id);">×</span>-->
								<span class="PageTitleBg0"><span class="PageTitleBg1"><span class="PageTitleBg2">起始页</span></span></span></a></div>
						<!--<div class="PageTitle" title="我的标题title"><a href="#" onfocus="this.blur();" onclick="return false;"><span class="PageCloseButton" title="关闭" onclick="">×</span><span class="PageTitleBg0"><span class="PageTitleBg1"><span class="PageTitleBg2">我的标题</span></span></span></a></div>
						<div class="PageTitle" title="我的标题title"><a href="#" onfocus="this.blur();" onclick="return false;"><span class="PageCloseButton" title="关闭" onclick="">×</span><span class="PageTitleBg0"><span class="PageTitleBg1"><span class="PageTitleBg2">我的标题2</span></span></span></a></div>
						<div class="PageTitle" title="我的标题title"><a href="#" onfocus="this.blur();" onclick="return false;"><span class="PageCloseButton" title="关闭" onclick="">×</span><span class="PageTitleBg0"><span class="PageTitleBg1"><span class="PageTitleBg2">我的标题9</span></span></span></a></div>-->
					</div>
				</div>
			</div>
		</div>
		<div id="filesDiv">
			<div class="inner" id="ContentWindow">
				<div id="StartPage" class="inside">
					<div id="StartPageContent" style="padding: 0.5em;">
						<div id="PathBox">
							<div>
								<span>当前位置：</span><input type="text" id="FolderPath" name="FolderPath" size="60" /><input type="button" value="Go" /></div>
							<div>
								<span>操作对象：</span><input type="text" id="FilePath" name="FilePath" size="40" /><input type="button" value="Go" /></div>
						</div>
						<div id="checkedbox">
						</div>
						<div>
							<form action="" target="_blank">
							<input type="hidden" name="act" value="remotedownload" />
							<input type="text" name="url" id="RemoteDownload" value="http://" size="80" />
							<input type="submit" name="" value="下载" />
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div id="footer">
			<div id="footerInner">
				<span id="StatusBar" style="text-align: center;">页面执行时间：<%=this.PageSpendTime%>
					毫秒 </span>
			</div>
		</div>
	</div>
</body>
</html>
